<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  var goods = [{
    imgs:[{
      small:"小图1.jpg",
      big:"大图1.jpg"
    },{
      small:"小图2.jpg",
      big:"大图2.jpg"
    }],
    price:"2499.00",
    name:"魅族 20 12GB+256GB 热爱粉 第二代骁龙8旗舰芯片 144Hz电竞直屏 支持67W快充",
    tip: "10万+",
    shop:"OPPO京东自营",
    tags:[{
      color:"red",
      text:"自营"
    },{
      color:"blue",
      text:"放心购"
    }]
  },{
    imgs:[],
    price:"3799.00",
    name:"144Hz电竞直屏 支持67W快充",
    tip: "5万+",
    shop:"自营",
    tags:[]
  },{
    imgs:[{
      small:"小图b.jpg",
      big:"大图b.jpg"
    }],
    price:"799.00",
    name:"第二代骁龙8旗舰芯片 144Hz电竞直屏 支持67W快充",
    tip: "1万+",
    shop:"京东自营",
    tags:[{
      color:"red",
      text:"自营"
    },{
      color:"pink",
      text:"券800-300"
    }]
  }];

  console.log(goods)
  // console.log(goods[0])
  // console.log(goods[0].tags)
  // console.log(goods[0].tags[0])
  // console.log(goods[0].tags[0].color)

  // 逐层解析

  for(var i=0;i<goods.length;i++){
    console.log("商品名称：" + goods[i].name)
    console.log("商品价格：" + goods[i].price)
    console.log("店铺：" + goods[i].shop)
    console.log("评价：" + goods[i].tip)

    for(var j=0;j<goods[i].imgs.length;j++){
      console.log("商品小图：" + goods[i].imgs[j].small)
      console.log("商品大图：" + goods[i].imgs[j].big)
    }
    
    for(var k=0;k<goods[i].tags.length;k++){
      console.log("标签颜色：" + goods[i].tags[k].color)
      console.log("标签文字：" + goods[i].tags[k].text)
    }

    console.log("=====");
  }
</script>
</html>